﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
using YGLAB_SON.Models;

namespace YGLAB_SON.Controllers
{
    public class AraController : Controller
    {
        //
        // GET: /Ara/

        public ActionResult Index()
        {
            return View();
        }


		  private UsersContext db = new UsersContext();

		  public ActionResult Yazar( string searchUser = "" )
        {


				try {

					 var usernames = Roles.GetUsersInRole( "Yazar" );

					 var adminUsers = db.UserProfiles.Where( x => usernames.Contains( searchUser ) ).ToList();
					 return View( adminUsers );
				}
				catch( Exception ex ) {

					 return View();
				}

				
        }





    }
}
